from appium.webdriver.common.appiumby import AppiumBy

from base.authorize_base import AuthorizeBase
from appium.webdriver import Remote

class Authorizepage(AuthorizeBase):
    def privacy_agree_button_click(self,driver:Remote):
        privacy_agree_button_xpath = self.privacy_agree_button()
        # return driver.find_element(AppiumBy.XPATH,privacy_agree_button_xpath).click()
        return self.click_new(driver,AppiumBy.XPATH,privacy_agree_button_xpath)

    def authorize_agree_button_click(self,driver:Remote):
        authorize_agree_button_xpath = self.privacy_agree_button()
        # return driver.find_element(AppiumBy.XPATH,authorize_agree_button_xpath).click()
        return self.click_new(driver,AppiumBy.XPATH,authorize_agree_button_xpath)

    def ad_close_button_click(self,driver:Remote):
        ad_close_button_xpath = self.ad_close_button()
        # return driver.find_element(AppiumBy.XPATH,ad_close_button_xpath).click()
        return self.click_new(driver,AppiumBy.XPATH,ad_close_button_xpath)

    def authorize_setup(self,driver:Remote):
        self.privacy_agree_button_click(driver)
        self.authorize_agree_button_click(driver)
        self.ad_close_button_click(driver)